<template>
  <div id="login">
    <div>
      <span>用户名：</span>
      <input type="text" v-model="username">
    </div>
    <div>
      <span>密码：</span>
      <input type="text" v-model="password">
    </div>
    <button @click="loginBtn">登录</button>
  </div>
</template>

<script>

export default {
  name: 'Login',
  components: {

  },
  data(){
    return {
      username: "",
      password: ""
    }
  },
  methods: {
    loginBtn(){
      const { username, password } = this;

      if(username == "admin" && password == 123456){
        this.$router.replace({
          name: "Index"
        })
      }
    }
  }
}
</script>
